package com.xuan.model;
import java.util.Objects;
public class User {
    private int id;
    private String name;
    private String mob;
    private String password;

    public User() {
    }

    public User(String mob, String password) {
        this.mob = mob;
        this.password = password;
    }

    public User(String name, String mob, String password) {
        this.name = name;
        this.mob = mob;
        this.password = password;
    }

    public User(int id, String name, String mob, String password) {
        this.id = id;
        this.name = name;
        this.mob = mob;
        this.password = password;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMob() {
        return mob;
    }

    public void setMob(String mob) {
        this.mob = mob;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof User)) return false;
        User user = (User) o;
        return getId() == user.getId();
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId());
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", mob='" + mob + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
